package com.tank.nio;

import lombok.extern.slf4j.Slf4j;

import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

/**
 * Created with IntelliJ IDEA.
 * User: SuQiEr
 * Date:2017/9/23 0023
 * Time: 下午 9:24
 * To change this template use File | Settings | File Templates.
 */
@Slf4j
public class OptionTest {

    public static void main(String[] args) throws InterruptedException {

//        List<String> list = Arrays.asList();
//        Optional<String> first = list.stream().filter(item -> item.equals("a")).findFirst();
//        first.orElseThrow(TestException::sayHello);

        ExecutorService exe = Executors.newSingleThreadExecutor();
        exe.submit( () -> System.out.println("run..........！"));
        exe.shutdown();
        while (!exe.isTerminated()) {
            System.out.println("xx！");
        }
    }
}
